package com.ruoyi.xiaoshou.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.xiaoshou.mapper.SalesOrderItemMapper;
import com.ruoyi.xiaoshou.domain.SalesOrderItem;
import com.ruoyi.xiaoshou.service.ISalesOrderItemService;
import com.ruoyi.common.core.text.Convert;

/**
 * 订单明细Service业务层处理
 * 
 * @author Rosou
 * @date 2025-06-17
 */
@Service
public class SalesOrderItemServiceImpl implements ISalesOrderItemService 
{
    @Autowired
    private SalesOrderItemMapper salesOrderItemMapper;

    /**
     * 查询订单明细
     * 
     * @param itemId 订单明细主键
     * @return 订单明细
     */
    @Override
    public SalesOrderItem selectSalesOrderItemByItemId(Long itemId)
    {
        return salesOrderItemMapper.selectSalesOrderItemByItemId(itemId);
    }

    /**
     * 查询订单明细列表
     * 
     * @param salesOrderItem 订单明细
     * @return 订单明细
     */
    @Override
    public List<SalesOrderItem> selectSalesOrderItemList(SalesOrderItem salesOrderItem)
    {
        return salesOrderItemMapper.selectSalesOrderItemList(salesOrderItem);
    }

    /**
     * 新增订单明细
     * 
     * @param salesOrderItem 订单明细
     * @return 结果
     */
    @Override
    public int insertSalesOrderItem(SalesOrderItem salesOrderItem)
    {
        return salesOrderItemMapper.insertSalesOrderItem(salesOrderItem);
    }

    /**
     * 修改订单明细
     * 
     * @param salesOrderItem 订单明细
     * @return 结果
     */
    @Override
    public int updateSalesOrderItem(SalesOrderItem salesOrderItem)
    {
        return salesOrderItemMapper.updateSalesOrderItem(salesOrderItem);
    }

    /**
     * 批量删除订单明细
     * 
     * @param itemIds 需要删除的订单明细主键
     * @return 结果
     */
    @Override
    public int deleteSalesOrderItemByItemIds(String itemIds)
    {
        return salesOrderItemMapper.deleteSalesOrderItemByItemIds(Convert.toStrArray(itemIds));
    }

    /**
     * 删除订单明细信息
     * 
     * @param itemId 订单明细主键
     * @return 结果
     */
    @Override
    public int deleteSalesOrderItemByItemId(Long itemId)
    {
        return salesOrderItemMapper.deleteSalesOrderItemByItemId(itemId);
    }
}
